package com.bosssoft.hr.train.j2se.colletion;
import com.bosssoft.hr.train.j2se.pojo.User;

/**
 * @Classname: BaseCollectionDemo
 * @Description:存储User对象
 * @author: zoubinyan
 * @Date: 2023/2/22
 */

public class BaseCollectionDemo {
    /**
     * 存储数据数量上限
     */
    private static final int MAX_COUNT = 10;

    /**
     @Description: 初始化数据
     */
    protected User[] generateData() {
        User[] users = new User[MAX_COUNT];
        for(int i = 1; i <= MAX_COUNT; i++) {
            // 字段较多构建简单字段满足作业要求即可
            users[i] = new User(
                    new Long(i),
                    //格式化为3位
                    String.format("BS%03d",i),
                    "同学"+i
            );
        }
        return users;
    }
}